Skip to content

Conditional return types on url() and its sibling helpers - #337

Merged
AJenbo merged 3 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/conditional-return-types-on-url-and-its-sibling-helpers
Aug 16, 2026
Merged

AJenbo merged 3 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/conditional-return-types-on-url-and-its-sibling-helpers

Conversation

@shuvroroy

@shuvroroy shuvroroy commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Laravel’s url('/login') now consistently resolves to string, while url() and url(null) resolve to UrlGenerator. This works across inline calls, assignments, named arguments, and template-bound calls.

Changes

  • Keep resolved conditional and template-substituted return types authoritative even when they contain no class.
  • Preserve named argument labels during call resolution.
  • Add regression coverage for positional, named, reordered, null, concatenated, assigned, and generic-wrapper calls.
  • Add Laravel demo and runtime assertion coverage.
  • Audit sibling helpers including redirect(), app(), view(), route(), action(), and secure_url().
  • Fix headless Blade caller inference exposed by the required Laravel analysis check.
  • Update the changelog and remove the completed L41 backlog item.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, examples/)
  • I have updated the config schema (config-schema.json)
  • I have added/updated tests to cover my changes

@codecov-commenter

codecov-commenter commented Aug 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shuvroroy
shuvroroy marked this pull request as ready for review August 11, 2026 12:51
@AJenbo
AJenbo force-pushed the feat/conditional-return-types-on-url-and-its-sibling-helpers branch from da95392 to 35beeb8 Compare August 16, 2026 04:34
@AJenbo

AJenbo commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Thanks, turned out there was a bit of overlap with some of the fixes I had been doing over the past few days, but there was till useful improvement

@AJenbo
AJenbo merged commit e6a15a7 into PHPantom-dev:main Aug 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants